package com.leo;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.Tooltip;
import javafx.scene.text.Font;
import javafx.stage.Stage;

/**
 * @ClassName LabelDemo
 * @Description 标签
 * @Author wangss
 * @date 2020.05.17 00:25
 * @Version 1.0
 */
public class LabelDemo extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {

        final Label textField = new Label();
        textField.setText("这是一个标签");

        textField.setLayoutX(10d);
        textField.setLayoutY(80d);

        textField.setPrefWidth(200d);

        textField.setFont(Font.font(24));

        // 提示
        Tooltip tooltip = new Tooltip("提示");
        tooltip.setFont(Font.font(20));
        textField.setTooltip(tooltip);

        Group group = new Group();
        group.getChildren().add(textField);

        Scene scene = new Scene(group);

        primaryStage.setScene(scene);
        primaryStage.setTitle("input box");
        primaryStage.setWidth(600d);
        primaryStage.setHeight(600d);
        primaryStage.show();
    }
}
